﻿<%@ Page Title="Statistics" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="Statistics.aspx.vb" Inherits="Final.Statistics" %>
<%@ Register Assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="System.Web.UI.DataVisualization.Charting" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .style2
        {
            width: 251px;
            height: 64px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
 <div>
        <table width="920" cellspacing="30" 
            style="border-top-style: groove; border-right-style: groove; border-left-style: groove;">
             <tr>
             <td class="style1">
             <h1 style="border-bottom-style: groove">Statistics</h1>
        <br />
       </td>
       </tr>
      
    </table>
    <table width="920" cellspacing="30" style="border-bottom-style: groove; border-right-style: groove; border-left-style: groove;">
       <tr>
       <td>
        <h1>Number of Comments Per Researcher:</h1>
        </td>
        <td>

<asp:Chart ID="Chart1" runat="server" DataSourceID="CommPerSearchDataSource">
    <Series>
        <asp:Series Name="Series1" XValueMember="Author" 
            YValueMembers="NumberOfComments">
        </asp:Series>
    </Series>
    <ChartAreas>
        <asp:ChartArea Name="ChartArea1">
        </asp:ChartArea>
    </ChartAreas>
</asp:Chart>
    <asp:SqlDataSource ID="CommPerSearchDataSource" runat="server" 
        ConnectionString="<%$ ConnectionStrings:FinalConnectionString %>" 
        ProviderName="<%$ ConnectionStrings:FinalConnectionString.ProviderName %>" 
        SelectCommand="SELECT [Author], [NumberOfComments] FROM [NumberOfComments] ORDER BY [NumberOfComments] DESC">
    </asp:SqlDataSource>  
    </td> 
    </tr>
    <tr>
    <td>
        <h1>Number of Tags Per Resarch:</h1>
    </td>
    <td>

        <asp:Chart ID="Chart2" runat="server" 
            DataSourceID="TagPerResearchSqlDataSource">
            <Series>
                <asp:Series Name="Series1" XValueMember="Research_fkID" 
                    YValueMembers="NumberOfTags" ChartType="Spline">
                </asp:Series>
            </Series>
            <ChartAreas>
                <asp:ChartArea Name="ChartArea1">
                </asp:ChartArea>
            </ChartAreas>
        </asp:Chart>
        <asp:SqlDataSource ID="TagPerResearchSqlDataSource" runat="server" 
            ConnectionString="<%$ ConnectionStrings:FinalConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:FinalConnectionString.ProviderName %>" 
            SelectCommand="SELECT [Research_fkID], [NumberOfTags] FROM [NumberOfTags]">
        </asp:SqlDataSource>

        </td> 
        </tr> 

        <tr>
    <td>
        <h1>Number of Likes Per Resarch:</h1>
    </td>
    <td>

<asp:Chart ID="Chart3" runat="server" DataSourceID="LikesPerResearchDataSource">
            <Series>
                <asp:Series Name="Series1" ChartType="Bar" XValueMember="Title" 
                    YValueMembers="CountOfReader">
                </asp:Series>
            </Series>
            <ChartAreas>
                <asp:ChartArea Name="ChartArea1">
                </asp:ChartArea>
            </ChartAreas>
        </asp:Chart>

        
        <asp:SqlDataSource ID="LikesPerResearchDataSource" runat="server" 
            ConnectionString="<%$ ConnectionStrings:FinalConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:FinalConnectionString.ProviderName %>" 
            SelectCommand="SELECT [CountOfReader], [Reader], [Title], [ID] FROM [ResearchesLikesView] ORDER BY [CountOfReader] DESC, [ID]">
        </asp:SqlDataSource>
        </td>
        </tr>

        <tr>
    <td>
        <h1>Number of Comments Title Per Resarch:</h1>
    </td>
    <td>
       
        <asp:Chart ID="Chart5" runat="server" 
            DataSourceID="CommTitlePerResearchSqlDataSource">
            <Series>
                <asp:Series Name="Series1" XValueMember="Title" 
                    YValueMembers="NumberOfTitlesPerPesearch" ChartType="Pie">
                </asp:Series>
            </Series>
            <ChartAreas>
                <asp:ChartArea Name="ChartArea1">
                </asp:ChartArea>
            </ChartAreas>
        </asp:Chart>
       
       
        <asp:SqlDataSource ID="CommTitlePerResearchSqlDataSource" runat="server" 
            ConnectionString="<%$ ConnectionStrings:FinalConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:FinalConnectionString.ProviderName %>" 
            SelectCommand="SELECT [Title], [NumberOfTitlesPerPesearch] FROM [NumOfTitlePerResearch] ORDER BY [Title]">
        </asp:SqlDataSource>
       
       
       </td>
            
       </tr> 


       <tr>
    <td>
        <h1>Number of Researcher Views Per Research:</h1>
    </td>
    <td>

<asp:Chart ID="Chart6" runat="server" 
            DataSourceID="ResearcherViewsPerResearchDataSource">
               <Series>
                   <asp:Series Name="Series1" ChartType="FastLine" XValueMember="Title" 
                       YValueMembers="CountOfResearchViewsByResearchers" YValuesPerPoint="2">
                   </asp:Series>
               </Series>
               <ChartAreas>
                   <asp:ChartArea Name="ChartArea1">
                   </asp:ChartArea>
               </ChartAreas>
           </asp:Chart>
        <asp:SqlDataSource ID="ResearcherViewsPerResearchDataSource" runat="server" 
            ConnectionString="<%$ ConnectionStrings:FinalConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:FinalConnectionString.ProviderName %>" 
            SelectCommand="SELECT [Title], [AddedBy], [CountOfResearchViewsByResearchers] FROM [ResearcherViewsPerResearch]">
        </asp:SqlDataSource>
    </td>
           
    </tr>

    </table> 
</div>

</asp:Content>